import request from '@/utils/request'

const base_api = '/admin/system/sysUser'

// 分页查询
export const GetSysUserListByPage = (pageNum, pageSize, queryDto) => {
  return request({
    url: `${base_api}/getSysUserByPage`,
    method: 'get',
    params: {
      queryDto,
      pageNum,
      pageSize,
    },
  })
}

// 用户添加
export const AddSysUser = sysUser => {
  return request({
    url: '/admin/system/sysUser/addSysUser',
    method: 'post',
    data: sysUser,
  })
}

// 用户的修改
export const UpdateSysUser = sysUser => {
  return request({
    url: '/admin/system/sysUser/updateSysUser',
    method: 'put',
    data: sysUser,
  })
}

// 删除用户
export const DeleteSysUserById = userId => {
  return request({
    url: `/admin/system/sysUser/deleteById/${userId}`,
    method: 'delete',
  })
}

// 给用户分配角色请求  修改用户的角色(权限)
export const DoAssignRoleToUser = assginRoleVo => {
  return request({
    url: '/admin/system/sysUser/doAssign',
    method: 'post',
    data: assginRoleVo,
  })
}
